1. Field of the Invention
The present invention relates to an encoding apparatus which switches an encoding method by detecting a movement of input image data, and encodes the image data with high efficiency.
2. Related Background Art
In recent years, commercial VTRs have been proposed for encoding an image signal with high efficiency, and recording and reproducing the encoded image signal on/from a medium such as a magnetic tape.
In a VTR of this type, an image signal is divided into blocks each including a predetermined number of pixels, and each image block is subjected to an orthogonal transform such as a discrete cosine transform (to be referred to as DCT hereinafter). The transformed coefficients are quantized, and the quantized value is recorded via entropy encoding.
As a recent image compression method, one using DCT is popular, and movement adaptive processing is performed for improving encoding efficiency upon execution of the DCT.
The movement adaptive processing is performed for the following purpose. Normally, DCT is performed in units of blocks each including 8.times.8 pixels in a frame. In the case of a moving image, intraframe processing lowers the interfield correlation, and frequency components in the vertical direction are generated, thus decreasing encoding efficiency. For this reason, a movement is detected, and a block including a movement is subjected to a DCT while dividing processing for 8.times.8 pixels into two fields each including 4.times.8 pixels, thereby improving encoding efficiency.
In the movement detection method, an interfield difference is calculated, and whether or not a block includes a movement is detected based on the absolute value of the difference.
A movement detection device used in, e.g., a conventional digital VTR is described in detail below.
FIG. 1 is a block diagram of the movement detection device used in, e.g., a conventional digital VTR.
Referring to FIG. 1, a digital moving image signal is input to an input terminal 1 in units of orthogonal transform blocks each consisting of 8 (vertical).times.8 (horizontal) pixels. The digital moving image signal is supplied to a delay line 2 having a given delay amount and a subtracter 3. The output from the delay line 2 is supplied to the subtracter 3.
The subtracter 3 calculates the difference value between the current digital moving image signal and that at the same position one field before, and outputs the difference value. The output from the subtracter 3 is supplied to an absolute circuit 4, and the absolute circuit 4 outputs the absolute value of the input difference value. The absolute value is supplied to an adder 5, and the output from the adder 5 is supplied to a delay line 6 having a given delay amount. The output from the delay line 6 is supplied to the adder 5.
The delay amount of the delay line 6 is set to be one sample time, and the adder 5 outputs the sum total of the absolute value outputs (the absolute values of interfield differences). The output from the delay line 6 is supplied to a movement discrimination circuit 7. The movement discrimination circuit 7 discriminates the presence/absence of a movement by comparing the sum total of the absolute values of the difference values with a predetermined threshold value, and outputs a movement discrimination signal from an output terminal 8.
As described above, by utilizing the fact that the movement of an image becomes vertical high-frequency components in a spatial frequency domain, the movement detection device in the conventional digital VTR performs movement discrimination of an image in each block (8.times.8 pixels) on the basis of the sum total of the absolute values of interfield difference values calculated for a digital moving image signal input in units of orthogonal transform blocks (blocks each including, e.g., 8.times.8 pixels).
Since the above-mentioned prior art adopts a method of detecting the presence/absence of movement of an image in each block on the basis of the sum total of the absolute values of interfield difference values (difference absolute values between all pairs of pixels in the vertical direction) calculated in units of blocks, if an original image has a fine pattern (e.g., oblique stripes), the sum total of the absolute values of the difference values inevitably becomes large independent of the presence/absence of a movement, and the presence of a movement may be erroneously detected.
For example, a case is examined below wherein the above-mentioned movement detection is performed when data in a pixel block have correlation in units of two lines.
FIGS. 2A to 2C show a block (8.times.8 pixels) in which data have correlation in units of two lines. In FIGS. 2A to 2C, an open circle indicates a bright pixel, and a full circle indicates a dark pixel.
According to the above-mentioned movement detection method, a strong interfield correlation is detected in FIG. 2A, and a weak interfield correlation is detected in FIG. 2B.
Therefore, in FIG. 2B, intrafield processing (intrafield 4.times.8 DCT processing) is performed. Upon execution of 4.times.8 DCT processing for the block shown in FIG. 2B, intrablock data are re-sorted, as shown in FIG. 2C. Therefore, the block shown in FIG. 2B undesirably has a maximum vertical frequency. As described above, when intraframe or intrafield 10 processing is selected based on the above-mentioned movement detection method, coefficients in a high-frequency region upon execution of an orthogonal transform become undesirably high, resulting in low encoding efficiency.